package com.example.handlers;

import com.example.enums.SysHandlerEnum;
import com.example.po.SysJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class SysMQHandler implements SysHandler {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public boolean isMatch(SysJob sysJob) {
        return SysHandlerEnum.MQSendHandler.getCode().equalsIgnoreCase(sysJob.getType());
    }

    @Override
    public void handler(SysJob sysJob) throws Exception {
        logger.warn("MQ发送成功: " + sysJob.getId());
    }
}
